package com.atguigu.gmall.model.list;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;

//JSR303 的规范。 JCP
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


/**
 *      * @RequestParam(value = "category3Id",required = false) Long category3Id,
 *      * @RequestParam(value = "trademark",required = false)String trademark,
 *      * @RequestParam(value = "order",required = false)String order,
 *      * @RequestParam(value = "pageNo",required = false)Long pageNo,
 *      * @RequestParam(value = "props",required = false)String props[],
 *      * @RequestParam(value = "keyword",required = false)String keyword
 */
// 封装查询条件
@Data
public class SearchParam {

    // ?category3Id=61&trademark=2:华为&props=23:4G:运行内存&order=1:desc
    private Long category1Id;;//三级分类id
    private Long category2Id;
//    @NotNull(message = "这个是三级分类，必须传")
    private Long category3Id;
    // trademark=2:华为


    private String trademark;//品牌

//    @Email
    private String keyword;//检索的关键字

    // props=23:4G:运行内存
    //平台属性Id 平台属性值名称 平台属性名
    private String[] props;//页面提交的数组




    // 排序规则
    // 1:hotScore    2:price    2:desc  1:asc
//    @Length(min = 6,max = 16,message = "最小6位字符串，最大16位字符串")
    private String order = ""; // 1：综合排序/热点  2：价格

//    @Pattern(regexp = "")
    private Integer pageNo = 1;//分页信息
    private Integer pageSize = 3; // 每页默认显示的条数


}
